package com.zsw.alancomicserver.util;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;

public class DateUtil {

    public static final String FORMAT_DATE = "yyyy-MM-dd HH:mm:ss";

    public static String toDateString(Timestamp timestamp) {
        SimpleDateFormat sdf = new SimpleDateFormat(FORMAT_DATE);
        return sdf.format(timestamp);
    }

    public static void main(String[] args) {
        Timestamp timestamp = new Timestamp(System.currentTimeMillis());
        System.out.println(DateUtil.toDateString(timestamp));
    }
}
